All Questions
Tagged with programming-challengepython-3.x
448 questions
7votes
4answers
942views
Project Euler #54: class for poker hands
I'm working right now on Project Euler problem 54, and I figured that this was the perfect opportunity to try to work with classes. This is my first time, so I'm sure that there are a lot of style, ...
6votes
2answers
232views
(HackerRank) Project Euler+ #250: 250250
Link to problem: linkNumber of solvers: 27 out of 844Solve rate (per person): 3.199%Success rate (over all submissions): 1.78% Project Euler+ on HackerRank is basically supposed to be a generalization ...
11votes
4answers
2kviews
Leetcode 93: Restore IP Addresses
(Source: Leetcode 93: Restore IP Addresses [Medium])(Topics: [String] [Backtracking]) The problem is as follows: Definition: A valid IP address is defined to consist of exactly four integers ...
5votes
5answers
840views
Bracket matching - Advent of Code 2021 Day 10
The following code solves Advent Of Code 2021 Day 10. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing brackets. ...
2votes
1answer
50views
Optimal Extraction of Longest Sorted Sequence from Individually Sorted Bucket Arrays Without Repetitions
Consider a bucket array containing sorted and/or empty buckets, and the goal is to extract the longest possible sequence in sorted order, under the following conditions: Only one element in each ...
5votes
1answer
226views
Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"
Related to this question I am still looking for a solution to Project Euler Problem 566 (see link for a nice simulation also): Adam plays the following game with his birthday cake. He cuts a piece ...
1vote
1answer
136views
Read millions of integers from stdin and process them in Python within 2 seconds
This is a competitive programming problem which has never been solved in Python within the time limit of 2 seconds. It is about Disjoint Set Union: Source: Algorithms In Context #10: Disjoint Sets ...
6votes
2answers
722views
Making a Rock Paper Scissors game in Python - How to reduce repetition and make it more effective?
I am a "new" coder to Python - saying this because I got stuck in the tutorial hell - and I saw that doing projects was a way of consolidating what I had learnt from those tutorials, so here ...
4votes
1answer
180views
Roman numerals look and say sequence
I was practicing question 1 of the 2020 british informatics olympiad past paper: The Roman look-and-say description of a string (of Is, Vs, Xs, Ls, Cs, Ds and Ms) is made by taking each block of ...
2votes
1answer
171views
Codewars 4 Kyu kata: "Most frequently used words in a text"
This was the first kata I found hard so I wanted to ask about it. Any ways I could I have done it better? here's the question -> Most frequently used words in a text ...
3votes
1answer
97views
Finding the number of "block chains" that are a certain length and begin with a certain string
I'm currently practicing for the british informatics olympiad by doing past papers. I was doing question 3 of the 2019 paper: A set of children’s blocks, each illustrated with a single different ...
4votes
1answer
454views
Advent of Code 2023 day 1: Trebuchet
Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and ...
0votes
1answer
126views
HackerRank Project Euler 12 (Python) | Highly Divisible Triangular Numbers
I again share my Python code which didn't pass time limit test cases in the HackerRank contest of ProjectEuler. ...
3votes
1answer
363views
Python function to find the count of digits of numerals in base n up to a given limit
This is a simple exercise to find the count of digits of all numerals in a given base up to a given limit (not including the limit), I wrote it to determine the ratio of bytes saved when the numbers ...
1vote
1answer
162views
Calculate the cost of Biryani lessons
Problem: According to a recent survey, Biryani is the most ordered food. Chef wants to learn how to make world-class Biryani from a MasterChef. The chef will be required to attend the MasterChef's ...